I have a link module "A" |
Re: Print the names of the link modules associated with an object
You can use function "module" to get the link module handle either from a link or from a link reference:
Object o = current
LinkRef lr = null
Link l = null
for lr in o <- "*" do
{
print "in: " fullName(module(lr)) "\n"
}
for l in o -> "*" do
{
print "out: " fullName(module(l)) "\n"
}
|
Re: Print the names of the link modules associated with an object SystemAdmin - Fri Nov 19 03:00:40 EST 2010
You can use function "module" to get the link module handle either from a link or from a link reference:
Object o = current
LinkRef lr = null
Link l = null
for lr in o <- "*" do
{
print "in: " fullName(module(lr)) "\n"
}
for l in o -> "*" do
{
print "out: " fullName(module(l)) "\n"
}
|
Re: Print the names of the link modules associated with an object
I never had luck with the "for lnk in obj->NameLinkMod loop". I believe that it will find NameLinkMod only if its a fully qualified name like "/MyProject/MyLinkFolder/MyLinkModule", or if its unqualified like "MyLinkModule" then it must be in the 'current' folder, or if its a partially qualified name like MyLinkFolder/MyLinkModule" when the current folder is the top project. The problem being, of course, where is the 'current folder' when running the script? No, gets too messy for me. It seems to me that the script would probably want to find any link in a module named "MyLinkModule" and it doesn't care where it is; or specifically in which project it resides.
string NameLinkMod = "MyLinkModule"
Link lnk
Module mLink
for lnk in obj->"*" do
{ mLink = module(lnk)
if (null mLink or name(mLink) != NameLinkMod) continue // wrong kind of link
// Deal with this link I care about
}
|